package com.cakin.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @ClassName: HelloController
 * @Description: 控制器
 * @Date: 2020/6/14
 * @Author: cakin
 */
@Controller
@RequestMapping("/hello")
public class HelloController {
    // localhost:8080/hello/h1
    @RequestMapping("/h1")
    public String hello(Model model){
        // 封装数据
        model.addAttribute("msg","hello Spring mvc annotation!");
        return "hello"; // 会被视图解析器处理
    }
}
